package net.wanho.util;

import org.apache.shiro.crypto.hash.Md5Hash;

/**
 * 密码加密工具类
 */
public class PwdUtil {

    /**
     * 加密
     * @param source
     * @param salt
     * @param hashIterations
     * @return
     */
    public static String encrypt(Object source, Object salt, int hashIterations) {
        return new Md5Hash(source, salt, hashIterations).toHex();
    }

    /**
     * 加密
     * @param source
     * @return
     */
    public static String encrypt(Object source) {
        return new Md5Hash(source, "wanho", 1024).toHex();
    }

}
